<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>路由规则</title>
	</head>
	<body>
		<div id="app">
			<router-link to="/user">用户</router-link>
			<router-link to="/dept">部门</router-link>
			<router-view></router-view>
			
		</div>
		<script src="../js/vue.js"></script>
		<script src="../js/vue-router.js"></script>
		<script>
			const user={
				template:'<h1>111</>'
			}
			const dept={
				template:'<h1>222</>'
			}
			const router= new VueRouter({
				routes:[
					{path:'/',redirect:'/user '},
					{path:'/user',component:user},
					{path:'/dept',component:dept}
				]
			})
			
			
			const app=new Vue({
				el:"#app",
				router
			})
		</script>
	</body>
</html>

